<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>声明一个变量，为它赋值，然后显示出来</title>
</head>

<body>
    <script>
        var firstname;
        firstname = "Hege";
        document.write(firstname);
        document.write("<br />");
        firstname = "Tove";
        document.write(firstname);
    </script>
    <p>上面的脚本定义了一个变量，给变量分配一个值并显示，再次修改变量的值后，再次显示。
    </p>
</body>

</html>